package com.quality.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.quality.business.domain.enums.WeatherDataEnum;
import lombok.Data;

/**
 * 
 * @TableName weather-data
 */
@TableName(value ="weather_data")
@Data
public class WeatherData extends TableFieldAbstract implements Serializable {
    /**
     * 
     */
    @TableField(value = "data_time")
    private Date dataTime;

    /**
     * 
     */
    @TableField(value = "qualitylevel")
    private String qualitylevel;

    /**
     * 
     */
    @TableField(value = "AQI")
    private Integer aqi;

    /**
     * 
     */
    @TableField(value = "AQI_Rank")
    private Integer aqiRank;

    /**
     * 
     */
    @TableField(value = "PM25")
    private Integer pm25;

    /**
     * 
     */
    @TableField(value = "PM10")
    private Integer pm10;

    /**
     * 
     */
    @TableField(value = "SO2")
    private Integer so2;

    /**
     * 
     */
    @TableField(value = "NO2")
    private Integer no2;

    /**
     * 
     */
    @TableField(value = "CO")
    private Double co;

    /**
     * 
     */
    @TableField(value = "O3")
    private Integer o3;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public Object getValue(String field){
        WeatherDataEnum weatherDataEnum = WeatherDataEnum.valueOf(field);
        switch (weatherDataEnum){
            case data_time:
                return this.dataTime;
            case qualitylevel:
                return this.qualitylevel;
            case AQI:
                return this.aqi;
            case AQI_Rank:
                return this.aqiRank;
            case PM25:
                return this.pm25;
            case PM10:
                return this.pm10;
            case SO2:
                return this.so2;
            case NO2:
                return this.no2;
            case CO:
                return this.co;
            case o3:
                return this.o3;
            default:
                return "";
        }
    }
}